#include "lirc_out.h"

int air_control(int key_val){
	switch (key_val){
		case OPEN_17:
			system("irsend SEND_ONCE AIR KEY_17");
			break;
		case OPEN_18:
			system("irsend SEND_ONCE AIR KEY_18");
			break;
		case OPEN_19:
			system("irsend SEND_ONCE AIR KEY_19");
			break;
		case OPEN_20:
			system("irsend SEND_ONCE AIR KEY_20");
			break;
		case OPEN_21:
			system("irsend SEND_ONCE AIR KEY_21");
			break;
		case OPEN_22:
			system("irsend SEND_ONCE AIR KEY_22");
			break;
		case OPEN_23:
			system("irsend SEND_ONCE AIR KEY_23");
			break;
		case OPEN_24:
			system("irsend SEND_ONCE AIR KEY_24");
			break;
		case OPEN_25:
			system("irsend SEND_ONCE AIR KEY_25");
			break;
		case OPEN_26:
			system("irsend SEND_ONCE AIR KEY_26");
			break;
		case OPEN_27:
			system("irsend SEND_ONCE AIR KEY_27");
			break;
		case OPEN_28:
			system("irsend SEND_ONCE AIR KEY_28");
			break;
		case OPEN_29:
			system("irsend SEND_ONCE AIR KEY_29");
			break;
		case OPEN_30:
			system("irsend SEND_ONCE AIR KEY_30");
			break;
		case CLOSE:
			system("irsend SEND_ONCE AIR KEY_EXIT");
			break;
		default:
			break;
	}
	return 0;
}

int main(){
	int i = 0;
	DEBUG("lirc test");
	for(i = OPEN_17;i <= CLOSE; i++){
		if(i != CLOSE)
			DEBUG("OP: open %d",i+16);
		else
			DEBUG("OP: CLOSE AIR-C");
		air_control(i);
	}
	return 0;
}
